package com.acme.bankapp.domain;
import com.acme.bankapp.domain.Account;
import com.acme.bankapp.exception.*;
public class SavingAccount extends Account {
	private double balance;
	SavingAccount(double startBalance) {
		super();
		this.balance = startBalance;
	}
	@Override
	void deposite(double delta) {
		this.balance += delta;
	}
	@Override
	void withdraw(double delta) throws NotEnoughFundsException {
		if (this.balance >= delta) {
			throw new NotEnoughFundsException();
		}
		else 
			if (this.balance >= delta) {
				this.balance -= delta;
			}
	}
	@Override
	public double getBalance() {
		return this.balance;
	}
}
